package com.wish.wishsystem_management.service.impl;

import com.wish.wishsystem_management.entity.EsSyncTime;
import com.wish.wishsystem_management.mapper.EsSyncTimeMapper;
import com.wish.wishsystem_management.service.IEsSyncTimeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.HashMap;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author zhaiwj
 * @since 2021-03-22
 */
@Service
public class EsSyncTimeServiceImpl extends ServiceImpl<EsSyncTimeMapper, EsSyncTime> implements IEsSyncTimeService {

    @Override
    public void updateEsSyncTimeAll(HashMap<String, Object> map) {
        baseMapper.updateEsSyncTimeAll(map);
    }

    public void updateEsSyncTimeByTableName(HashMap<String, Object> map) {
        baseMapper.updateEsSyncTimeByTableName(map);
    }
    @Override
    public Date selectTime(String tableName) {
        EsSyncTime esSyncTime = baseMapper.selectTime(tableName);
        return esSyncTime.getSyncTime();
    }
}
